package com.sleep.drug_traceability.controller;

import com.sleep.drug_traceability.service.LoginService;
import com.sleep.drug_traceability.vo.Result;
import com.sleep.drug_traceability.vo.params.LoginParam;
import com.sleep.drug_traceability.vo.params.RegisterParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Sleep-6000
 * @date 2022/4/23
 */
@RestController
@RequestMapping("register")
public class ResisterController {
    @Autowired
    private LoginService loginService;

    /**
     * 注册
     * @param registerParam registerParam
     * @return token
     */
    @PostMapping
    public Result register(@RequestBody RegisterParam registerParam){
        return loginService.register(registerParam);
    }
}
